import request from '@/utils/request'
import { getToken } from '@/utils/auth'

// 获取所有的信息单
export function getCusInfoOrders(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/getCusInfoOrders',
    method: 'get',
    params: query
  })
}

export function editTraceInfo(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/save',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

export function addInfoOrder(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/add',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

export function sendTraceInfo(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/send',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

export function getCusOrderTraces(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusinfotrace/getCusOrderTraces',
    method: 'get',
    params: query
  })
}

export function finalTraceInfo(data) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/close',
    headers: { 'Content-Type': 'multipart/form-data' },
    method: 'post',
    data
  })
}

export function getFinalTypes(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/getFinalTypes',
    method: 'get',
    params: query
  })
}

export function checkOrderInfoNumber(query) {
  return request({
    url: '/wxh-cloud-rest/rest/' + getToken() + '/cusInfoOrder/' + query + '/checkOrderInfoNumber',
    method: 'get',
    params: null
  })
}
